package com.david.jnitest

import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity

//参考链接：https://juejin.cn/column/6973486991916662798   https://juejin.cn/post/7125338583959306248
class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // Example of a call to a native method
//        sample_text.text = stringFromJNI()
        findViewById<TextView>(R.id.sample_text).text = MyStringUtils.stringFromJNI() + MyStringUtils.add() + MyStringUtils.getCString()
    }

    /**
     * A native method that is implemented by the 'native-lib' native library,
     * which is packaged with this application.
     */
//    external fun stringFromJNI(): String

//    companion object {

//        // Used to load the 'native-lib' library on application startup.
//        init {
//            System.loadLibrary("native-lib")
//        }
//    }
}
